home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 January: Mac OS SDK / Dev.CD Jan 99 SDK1.toast / Development Kits / Interfaces&Libraries / Universal / Interfaces / AIncludes / CMApplication.a < prev    next >
Encoding:
Text File  |  1998-08-17  |  53.8 KB  |  1,893 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        CMApplication.a
  3. ;
  4. ;    Contains:    ColorSync API
  5. ;
  6. ;    Version:    Technology:    ColorSync 2.5
  7. ;                Release:    Universal Interfaces 3.2
  8. ;
  9. ;    Copyright:    © 1992-1998 by Apple Computer, Inc., all rights reserved.
  10. ;
  11. ;    Bugs?:        For bug reports, consult the following page on
  12. ;                the World Wide Web:
  13. ;
  14. ;                    http://developer.apple.com/bugreporter/
  15. ;
  16. ;
  17.     IF &TYPE('__CMAPPLICATION__') = 'UNDEFINED' THEN
  18. __CMAPPLICATION__ SET 1
  19.  
  20.     IF &TYPE('__MACTYPES__') = 'UNDEFINED' THEN
  21.     include 'MacTypes.a'
  22.     ENDIF
  23.     IF &TYPE('__QUICKDRAW__') = 'UNDEFINED' THEN
  24.     include 'Quickdraw.a'
  25.     ENDIF
  26.     IF &TYPE('__FILES__') = 'UNDEFINED' THEN
  27.     include 'Files.a'
  28.     ENDIF
  29.     IF &TYPE('__PRINTING__') = 'UNDEFINED' THEN
  30.     include 'Printing.a'
  31.     ENDIF
  32.     IF &TYPE('__CMICCPROFILE__') = 'UNDEFINED' THEN
  33.     include 'CMICCProfile.a'
  34.     ENDIF
  35.     IF &TYPE('__DISPLAYS__') = 'UNDEFINED' THEN
  36.     include 'Displays.a'
  37.     ENDIF
  38.  
  39.  
  40. kDefaultCMMSignature            EQU        'appl'
  41. ;  Macintosh 68K trap word 
  42.  
  43. cmTrap                            EQU        $ABEE
  44.  
  45. ;  PicComment IDs 
  46.  
  47. cmBeginProfile                    EQU        220
  48. cmEndProfile                    EQU        221
  49. cmEnableMatching                EQU        222
  50. cmDisableMatching                EQU        223
  51. cmComment                        EQU        224
  52. ;  PicComment selectors for cmComment 
  53.  
  54. cmBeginProfileSel                EQU        0
  55. cmContinueProfileSel            EQU        1
  56. cmEndProfileSel                    EQU        2
  57. cmProfileIdentifierSel            EQU        3
  58.  
  59. ;  Defines for version 1.0 CMProfileSearchRecord.fieldMask 
  60.  
  61. cmMatchCMMType                    EQU        $00000001
  62. cmMatchApplProfileVersion        EQU        $00000002
  63. cmMatchDataType                    EQU        $00000004
  64. cmMatchDeviceType                EQU        $00000008
  65. cmMatchDeviceManufacturer        EQU        $00000010
  66. cmMatchDeviceModel                EQU        $00000020
  67. cmMatchDeviceAttributes            EQU        $00000040
  68. cmMatchFlags                    EQU        $00000080
  69. cmMatchOptions                    EQU        $00000100
  70. cmMatchWhite                    EQU        $00000200
  71. cmMatchBlack                    EQU        $00000400
  72. ;  Defines for version 2.0 CMSearchRecord.searchMask 
  73.  
  74. cmMatchAnyProfile                EQU        $00000000
  75. cmMatchProfileCMMType            EQU        $00000001
  76. cmMatchProfileClass                EQU        $00000002
  77. cmMatchDataColorSpace            EQU        $00000004
  78. cmMatchProfileConnectionSpace    EQU        $00000008
  79. cmMatchManufacturer                EQU        $00000010
  80. cmMatchModel                    EQU        $00000020
  81. cmMatchAttributes                EQU        $00000040
  82. cmMatchProfileFlags                EQU        $00000080
  83. ;  Result codes 
  84.  
  85.                                                             ; General Errors 
  86. cmProfileError                    EQU        -170
  87. cmMethodError                    EQU        -171
  88. cmMethodNotFound                EQU        -175                ; CMM not present 
  89. cmProfileNotFound                EQU        -176                ; Responder error 
  90. cmProfilesIdentical                EQU        -177                ; Profiles the same 
  91. cmCantConcatenateError            EQU        -178                ; Profile can't be concatenated 
  92. cmCantXYZ                        EQU        -179                ; CMM cant handle XYZ space 
  93. cmCantDeleteProfile                EQU        -180                ; Responder error 
  94. cmUnsupportedDataType            EQU        -181                ; Responder error 
  95. cmNoCurrentProfile                EQU        -182                ; Responder error 
  96.                                                             ; Profile Access Errors 
  97. cmElementTagNotFound            EQU        -4200
  98. cmIndexRangeErr                    EQU        -4201                ; Tag index out of range 
  99. cmCantDeleteElement                EQU        -4202
  100. cmFatalProfileErr                EQU        -4203
  101. cmInvalidProfile                EQU        -4204                ; A Profile must contain a 'cs1 ' tag to be valid 
  102. cmInvalidProfileLocation        EQU        -4205                ; Operation not supported for this profile location 
  103. cmCantCopyModifiedV1Profile        EQU        -4215                ; Illegal to copy version 1 profiles that have been modified 
  104.                                                             ; Profile Search Errors 
  105. cmInvalidSearch                    EQU        -4206                ; Bad Search Handle 
  106. cmSearchError                    EQU        -4207
  107. cmErrIncompatibleProfile        EQU        -4208                ; Other ColorSync Errors 
  108. cmInvalidColorSpace                EQU        -4209                ; Profile colorspace does not match bitmap type 
  109. cmInvalidSrcMap                    EQU        -4210                ; Source pix/bit map was invalid 
  110. cmInvalidDstMap                    EQU        -4211                ; Destination pix/bit map was invalid 
  111. cmNoGDevicesError                EQU        -4212                ; Begin/End Matching -- no gdevices available 
  112. cmInvalidProfileComment            EQU        -4213                ; Bad Profile comment during drawpicture 
  113. cmRangeOverFlow                    EQU        -4214                ; Color conversion warning that some output color values over/underflowed and were clipped 
  114. cmNamedColorNotFound            EQU        -4216                ; NamedColor not found 
  115. cmCantGamutCheckError            EQU        -4217                ; Gammut checking not supported by this ColorWorld 
  116. ;  deviceType values for ColorSync 1.0 Device Profile access 
  117.  
  118. cmSystemDevice                    EQU        'sys '
  119. cmGDevice                        EQU        'gdev'
  120. ;  Commands for CMFlattenUPP(…) 
  121.  
  122. cmOpenReadSpool                    EQU        1
  123. cmOpenWriteSpool                EQU        2
  124. cmReadSpool                        EQU        3
  125. cmWriteSpool                    EQU        4
  126. cmCloseSpool                    EQU        5
  127. ;  Flags for PostScript-related functions 
  128.  
  129. cmPS7bit                        EQU        1
  130. cmPS8bit                        EQU        2
  131. ;  Flags for profile embedding functions 
  132.  
  133. cmEmbedWholeProfile                EQU        $00000000
  134. cmEmbedProfileIdentifier        EQU        $00000001
  135. ;  Commands for CMAccessUPP(…) 
  136.  
  137. cmOpenReadAccess                EQU        1
  138. cmOpenWriteAccess                EQU        2
  139. cmReadAccess                    EQU        3
  140. cmWriteAccess                    EQU        4
  141. cmCloseAccess                    EQU        5
  142. cmCreateNewAccess                EQU        6
  143. cmAbortWriteAccess                EQU        7
  144. cmBeginAccess                    EQU        8
  145. cmEndAccess                        EQU        9
  146.  
  147. ;  Abstract data type for memory-based Profile 
  148.  
  149.  
  150. ;  Abstract data type for Profile search result 
  151.  
  152.  
  153. ;  Abstract data type for BeginMatching(…) reference 
  154.  
  155.  
  156. ;  Abstract data type for ColorWorld reference 
  157.  
  158.  
  159. ;  Caller-supplied flatten function 
  160. ;  Caller-supplied progress function for Bitmap & PixMap matching routines 
  161. ;  Caller-supplied filter function for Profile search 
  162. ;  Caller-supplied function for profile access 
  163. ; typedef long                             CMError
  164.  
  165. ;  For 1.0 and 2.0 profile header variants 
  166. ;  CMAppleProfileHeader 
  167. CMAppleProfileHeader    RECORD 0
  168. cm1                         ds        CMHeader        ; offset: $0 (0)
  169.                          ORG 0
  170. cm2                         ds        CM2Header        ; offset: $0 (0)
  171. sizeof                     EQU *                    ; size:   $80 (128)
  172.                         ENDR
  173. ;  Param for CWConcatColorWorld(…) 
  174. CMConcatProfileSet        RECORD 0
  175. keyIndex                 ds.w    1                ; offset: $0 (0)        ;  Zero-based 
  176. count                     ds.w    1                ; offset: $2 (2)        ;  Min 1 
  177. profileSet                 ds.l    1                ; offset: $4 (4) <-- really an array of length one ;  Variable. Ordered from Source -> Dest 
  178. sizeof                     EQU *                    ; size:   $8 (8)
  179.                         ENDR
  180. ;  ColorSync color data types 
  181. CMRGBColor                RECORD 0
  182. red                         ds.w    1                ; offset: $0 (0)        ;  0..65535 
  183. green                     ds.w    1                ; offset: $2 (2)
  184. blue                     ds.w    1                ; offset: $4 (4)
  185. sizeof                     EQU *                    ; size:   $6 (6)
  186.                         ENDR
  187. CMCMYKColor                RECORD 0
  188. cyan                     ds.w    1                ; offset: $0 (0)        ;  0..65535 
  189. magenta                     ds.w    1                ; offset: $2 (2)
  190. yellow                     ds.w    1                ; offset: $4 (4)
  191. black                     ds.w    1                ; offset: $6 (6)
  192. sizeof                     EQU *                    ; size:   $8 (8)
  193.                         ENDR
  194. CMCMYColor                RECORD 0
  195. cyan                     ds.w    1                ; offset: $0 (0)        ;  0..65535 
  196. magenta                     ds.w    1                ; offset: $2 (2)
  197. yellow                     ds.w    1                ; offset: $4 (4)
  198. sizeof                     EQU *                    ; size:   $6 (6)
  199.                         ENDR
  200. CMHLSColor                RECORD 0
  201. hue                         ds.w    1                ; offset: $0 (0)        ;  0..65535. Fraction of circle. Red at 0 
  202. lightness                 ds.w    1                ; offset: $2 (2)        ;  0..65535 
  203. saturation                 ds.w    1                ; offset: $4 (4)        ;  0..65535 
  204. sizeof                     EQU *                    ; size:   $6 (6)
  205.                         ENDR
  206. CMHSVColor                RECORD 0
  207. hue                         ds.w    1                ; offset: $0 (0)        ;  0..65535. Fraction of circle. Red at 0 
  208. saturation                 ds.w    1                ; offset: $2 (2)        ;  0..65535 
  209. value                     ds.w    1                ; offset: $4 (4)        ;  0..65535 
  210. sizeof                     EQU *                    ; size:   $6 (6)
  211.                         ENDR
  212. CMLabColor                RECORD 0
  213. L                         ds.w    1                ; offset: $0 (0)        ;  0..65535 maps to 0..100 
  214. a                         ds.w    1                ; offset: $2 (2)        ;  0..65535 maps to -128..127.996 
  215. b                         ds.w    1                ; offset: $4 (4)        ;  0..65535 maps to -128..127.996 
  216. sizeof                     EQU *                    ; size:   $6 (6)
  217.                         ENDR
  218. CMLuvColor                RECORD 0
  219. L                         ds.w    1                ; offset: $0 (0)        ;  0..65535 maps to 0..100 
  220. u                         ds.w    1                ; offset: $2 (2)        ;  0..65535 maps to -128..127.996 
  221. v                         ds.w    1                ; offset: $4 (4)        ;  0..65535 maps to -128..127.996 
  222. sizeof                     EQU *                    ; size:   $6 (6)
  223.                         ENDR
  224. CMYxyColor                RECORD 0
  225. capY                     ds.w    1                ; offset: $0 (0)        ;  0..65535 maps to 0..1 
  226. x                         ds.w    1                ; offset: $2 (2)        ;  0..65535 maps to 0..1 
  227. y                         ds.w    1                ; offset: $4 (4)        ;  0..65535 maps to 0..1 
  228. sizeof                     EQU *                    ; size:   $6 (6)
  229.                         ENDR
  230. CMGrayColor                RECORD 0
  231. gray                     ds.w    1                ; offset: $0 (0)        ;  0..65535 
  232. sizeof                     EQU *                    ; size:   $2 (2)
  233.                         ENDR
  234. CMMultichannel5Color    RECORD 0
  235. components                 ds.b    5                ; offset: $0 (0)        ;  0..255 
  236.                          ORG 6
  237. sizeof                     EQU *                    ; size:   $6 (6)
  238.                         ENDR
  239. CMMultichannel6Color    RECORD 0
  240. components                 ds.b    6                ; offset: $0 (0)        ;  0..255 
  241. sizeof                     EQU *                    ; size:   $6 (6)
  242.                         ENDR
  243. CMMultichannel7Color    RECORD 0
  244. components                 ds.b    7                ; offset: $0 (0)        ;  0..255 
  245.                          ORG 8
  246. sizeof                     EQU *                    ; size:   $8 (8)
  247.                         ENDR
  248. CMMultichannel8Color    RECORD 0
  249. components                 ds.b    8                ; offset: $0 (0)        ;  0..255 
  250. sizeof                     EQU *                    ; size:   $8 (8)
  251.                         ENDR
  252. CMNamedColor            RECORD 0
  253. namedColorIndex             ds.l    1                ; offset: $0 (0)        ;  0..a lot 
  254. sizeof                     EQU *                    ; size:   $4 (4)
  255.                         ENDR
  256. CMColor                    RECORD 0
  257. rgb                         ds        CMRGBColor        ; offset: $0 (0)
  258.                          ORG 0
  259. hsv                         ds        CMHSVColor        ; offset: $0 (0)
  260.                          ORG 0
  261. hls                         ds        CMHLSColor        ; offset: $0 (0)
  262.                          ORG 0
  263. XYZ                         ds        CMXYZColor        ; offset: $0 (0)
  264.                          ORG 0
  265. Lab                         ds        CMLabColor        ; offset: $0 (0)
  266.                          ORG 0
  267. Luv                         ds        CMLuvColor        ; offset: $0 (0)
  268.                          ORG 0
  269. Yxy                         ds        CMYxyColor        ; offset: $0 (0)
  270.                          ORG 0
  271. cmyk                     ds        CMCMYKColor        ; offset: $0 (0)
  272.                          ORG 0
  273. cmy                         ds        CMCMYColor        ; offset: $0 (0)
  274.                          ORG 0
  275. gray                     ds        CMGrayColor        ; offset: $0 (0)
  276.                          ORG 0
  277. mc5                         ds        CMMultichannel5Color ; offset: $0 (0)
  278.                          ORG 0
  279. mc6                         ds        CMMultichannel6Color ; offset: $0 (0)
  280.                          ORG 0
  281. mc7                         ds        CMMultichannel7Color ; offset: $0 (0)
  282.                          ORG 0
  283. mc8                         ds        CMMultichannel8Color ; offset: $0 (0)
  284.                          ORG 0
  285. namedColor                 ds        CMNamedColor    ; offset: $0 (0)
  286.                          ORG 8
  287. sizeof                     EQU *                    ; size:   $8 (8)
  288.                         ENDR
  289. CMProfileSearchRecord    RECORD 0
  290. header                     ds        CMHeader        ; offset: $0 (0)
  291. fieldMask                 ds.l    1                ; offset: $40 (64)
  292. reserved                 ds.l    2                ; offset: $44 (68)
  293. sizeof                     EQU *                    ; size:   $4C (76)
  294.                         ENDR
  295. ; typedef struct CMProfileSearchRecord * CMProfileSearchRecordPtr
  296.  
  297. ; typedef CMProfileSearchRecordPtr *    CMProfileSearchRecordHandle
  298.  
  299. ;  Search definition for 2.0 
  300. CMSearchRecord            RECORD 0
  301. CMMType                     ds.l    1                ; offset: $0 (0)
  302. profileClass             ds.l    1                ; offset: $4 (4)
  303. dataColorSpace             ds.l    1                ; offset: $8 (8)
  304. profileConnectionSpace     ds.l    1                ; offset: $C (12)
  305. deviceManufacturer         ds.l    1                ; offset: $10 (16)
  306. deviceModel                 ds.l    1                ; offset: $14 (20)
  307. deviceAttributes         ds.l    2                ; offset: $18 (24)
  308. profileFlags             ds.l    1                ; offset: $20 (32)
  309. searchMask                 ds.l    1                ; offset: $24 (36)
  310. filter                     ds.l    1                ; offset: $28 (40)
  311. sizeof                     EQU *                    ; size:   $2C (44)
  312.                         ENDR
  313. ;  GetCWInfo structures 
  314. CMMInfoRecord            RECORD 0
  315. CMMType                     ds.l    1                ; offset: $0 (0)
  316. CMMVersion                 ds.l    1                ; offset: $4 (4)
  317. sizeof                     EQU *                    ; size:   $8 (8)
  318.                         ENDR
  319. CMCWInfoRecord            RECORD 0
  320. cmmCount                 ds.l    1                ; offset: $0 (0)
  321. cmmInfo                     ds.b    2 * CMMInfoRecord.sizeof ; offset: $4 (4)
  322. sizeof                     EQU *                    ; size:   $14 (20)
  323.                         ENDR
  324. ;  profile identifier structures 
  325. CMProfileIdentifier        RECORD 0
  326. profileHeader             ds        CM2Header        ; offset: $0 (0)
  327. calibrationDate             ds        CMDateTime        ; offset: $80 (128)
  328. ASCIIProfileDescriptionLen  ds.l 1                ; offset: $8C (140)
  329. ASCIIProfileDescription     ds.b    1                ; offset: $90 (144) <-- really an array of length one ;  variable length 
  330.                          ORG 146
  331. sizeof                     EQU *                    ; size:   $92 (146)
  332.                         ENDR
  333. ; typedef struct CMProfileIdentifier *    CMProfileIdentifierPtr
  334.  
  335. ;  packing formats 
  336.  
  337. cmNoColorPacking                EQU        $0000
  338. cmAlphaSpace                    EQU        $0080
  339. cmWord5ColorPacking                EQU        $0500
  340. cmLong8ColorPacking                EQU        $0800
  341. cmLong10ColorPacking            EQU        $0A00
  342. cmAlphaFirstPacking                EQU        $1000
  343. cmOneBitDirectPacking            EQU        $0B00
  344. cmAlphaLastPacking                EQU        $0000
  345. cm24_8ColorPacking                EQU        $2100
  346. cm32_8ColorPacking                EQU        $0800
  347. cm40_8ColorPacking                EQU        $2200
  348. cm48_8ColorPacking                EQU        $2300
  349. cm56_8ColorPacking                EQU        $2400
  350. cm64_8ColorPacking                EQU        $2500
  351. cm32_16ColorPacking                EQU        $2600
  352. cm48_16ColorPacking                EQU        $2900
  353. cm64_16ColorPacking                EQU        $2A00
  354. cm32_32ColorPacking                EQU        $2700
  355. ;  general colorspaces 
  356.  
  357. cmNoSpace                        EQU        0
  358. cmRGBSpace                        EQU        1
  359. cmCMYKSpace                        EQU        2
  360. cmHSVSpace                        EQU        3
  361. cmHLSSpace                        EQU        4
  362. cmYXYSpace                        EQU        5
  363. cmXYZSpace                        EQU        6
  364. cmLUVSpace                        EQU        7
  365. cmLABSpace                        EQU        8
  366. cmReservedSpace1                EQU        9
  367. cmGraySpace                        EQU        10
  368. cmReservedSpace2                EQU        11
  369. cmGamutResultSpace                EQU        12
  370. cmNamedIndexedSpace                EQU        16
  371. cmMCFiveSpace                    EQU        17
  372. cmMCSixSpace                    EQU        18
  373. cmMCSevenSpace                    EQU        19
  374. cmMCEightSpace                    EQU        20
  375. cmRGBASpace                        EQU        129
  376. cmGrayASpace                    EQU        138
  377. ;  supported CMBitmapColorSpaces - each of the following is a 
  378. ;  combination of a general colospace and a packing formats 
  379.  
  380. cmGray16Space                    EQU        10
  381. cmGrayA32Space                    EQU        138
  382. cmRGB16Space                    EQU        $0501
  383. cmRGB24Space                    EQU        $2101
  384. cmRGB32Space                    EQU        $0801
  385. cmRGB48Space                    EQU        $2901
  386. cmARGB32Space                    EQU        $1881
  387. cmRGBA32Space                    EQU        $0881
  388. cmCMYK32Space                    EQU        $0802
  389. cmCMYK64Space                    EQU        $2A02
  390. cmHSV32Space                    EQU        $0A03
  391. cmHLS32Space                    EQU        $0A04
  392. cmYXY32Space                    EQU        $0A05
  393. cmXYZ32Space                    EQU        $0A06
  394. cmLUV32Space                    EQU        $0A07
  395. cmLAB24Space                    EQU        $2108
  396. cmLAB32Space                    EQU        $0A08
  397. cmLAB48Space                    EQU        $2908
  398. cmGamutResult1Space                EQU        $0B0C
  399. cmNamedIndexed32Space            EQU        $2710
  400. cmMCFive8Space                    EQU        $2211
  401. cmMCSix8Space                    EQU        $2312
  402. cmMCSeven8Space                    EQU        $2413
  403. cmMCEight8Space                    EQU        $2514
  404.  
  405. ; typedef unsigned long                 CMBitmapColorSpace
  406.  
  407. CMBitmap                RECORD 0
  408. image                     ds.l    1                ; offset: $0 (0)
  409. width                     ds.l    1                ; offset: $4 (4)
  410. height                     ds.l    1                ; offset: $8 (8)
  411. rowBytes                 ds.l    1                ; offset: $C (12)
  412. pixelSize                 ds.l    1                ; offset: $10 (16)
  413. space                     ds.l    1                ; offset: $14 (20)
  414. user1                     ds.l    1                ; offset: $18 (24)
  415. user2                     ds.l    1                ; offset: $1C (28)
  416. sizeof                     EQU *                    ; size:   $20 (32)
  417.                         ENDR
  418.  
  419. ;  Classic Print Manager Stuff 
  420.  
  421. enableColorMatchingOp            EQU        12
  422. registerProfileOp                EQU        13
  423.  
  424. cmNoProfileBase                    EQU        0
  425. cmFileBasedProfile                EQU        1
  426. cmHandleBasedProfile            EQU        2
  427. cmPtrBasedProfile                EQU        3
  428. cmProcedureBasedProfile            EQU        4
  429. CMFileLocation            RECORD 0
  430. spec                     ds        FSSpec            ; offset: $0 (0)
  431. sizeof                     EQU *                    ; size:   $46 (70)
  432.                         ENDR
  433. CMHandleLocation        RECORD 0
  434. h                         ds.l    1                ; offset: $0 (0)
  435. sizeof                     EQU *                    ; size:   $4 (4)
  436.                         ENDR
  437. CMPtrLocation            RECORD 0
  438. p                         ds.l    1                ; offset: $0 (0)
  439. sizeof                     EQU *                    ; size:   $4 (4)
  440.                         ENDR
  441. CMProcedureLocation        RECORD 0
  442. proc                     ds.l    1                ; offset: $0 (0)
  443. refCon                     ds.l    1                ; offset: $4 (4)
  444. sizeof                     EQU *                    ; size:   $8 (8)
  445.                         ENDR
  446.  
  447. CMProfLoc                RECORD 0
  448. fileLoc                     ds        CMFileLocation ; offset: $0 (0)
  449.                          ORG 0
  450. handleLoc                 ds        CMHandleLocation ; offset: $0 (0)
  451.                          ORG 0
  452. ptrLoc                     ds        CMPtrLocation    ; offset: $0 (0)
  453.                          ORG 0
  454. procLoc                     ds        CMProcedureLocation ; offset: $0 (0)
  455.                          ORG 70
  456. sizeof                     EQU *                    ; size:   $46 (70)
  457.                         ENDR
  458. CMProfileLocation        RECORD 0
  459. locType                     ds.w    1                ; offset: $0 (0)
  460. u                         ds        CMProfLoc        ; offset: $2 (2)
  461. sizeof                     EQU *                    ; size:   $48 (72)
  462.                         ENDR
  463.  
  464. cmOriginalProfileLocationSize    EQU        72
  465. cmCurrentProfileLocationSize    EQU        72
  466.  
  467. ;  Struct and enums used for Profile iteration 
  468.  
  469. cmProfileIterateDataVersion1    EQU        $00010000
  470. CMProfileIterateData    RECORD 0
  471. dataVersion                 ds.l    1                ; offset: $0 (0)        ;  cmProfileIterateDataVersion1 
  472. header                     ds        CM2Header        ; offset: $4 (4)
  473. code                     ds.w    1                ; offset: $84 (132)
  474. name                     ds        Str255            ; offset: $86 (134)
  475. location                 ds        CMProfileLocation ; offset: $186 (390)
  476. sizeof                     EQU *                    ; size:   $1CE (462)
  477.                         ENDR
  478. ;  Caller-supplied callback function for Profile iteration 
  479. ;  Profile file and element access 
  480. ;
  481. ; pascal CMError CMNewProfile(CMProfileRef *prof, const CMProfileLocation *theProfile)
  482. ;
  483.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  484.         Macro
  485.         _CMNewProfile
  486.             move.l              #$0008001B,D0
  487.             dc.w                $ABEE
  488.         EndM
  489.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  490.         IMPORT_CFM_FUNCTION CMNewProfile
  491.     ENDIF
  492.  
  493. ;
  494. ; pascal CMError CMOpenProfile(CMProfileRef *prof, const CMProfileLocation *theProfile)
  495. ;
  496.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  497.         Macro
  498.         _CMOpenProfile
  499.             move.l              #$0008001C,D0
  500.             dc.w                $ABEE
  501.         EndM
  502.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  503.         IMPORT_CFM_FUNCTION CMOpenProfile
  504.     ENDIF
  505.  
  506. ;
  507. ; pascal CMError CMCloseProfile(CMProfileRef prof)
  508. ;
  509.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  510.         Macro
  511.         _CMCloseProfile
  512.             move.l              #$0004001D,D0
  513.             dc.w                $ABEE
  514.         EndM
  515.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  516.         IMPORT_CFM_FUNCTION CMCloseProfile
  517.     ENDIF
  518.  
  519. ;
  520. ; pascal CMError CMUpdateProfile(CMProfileRef prof)
  521. ;
  522.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  523.         Macro
  524.         _CMUpdateProfile
  525.             move.l              #$00040034,D0
  526.             dc.w                $ABEE
  527.         EndM
  528.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  529.         IMPORT_CFM_FUNCTION CMUpdateProfile
  530.     ENDIF
  531.  
  532. ;
  533. ; pascal CMError CMCopyProfile(CMProfileRef *targetProf, const CMProfileLocation *targetLocation, CMProfileRef srcProf)
  534. ;
  535.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  536.         Macro
  537.         _CMCopyProfile
  538.             move.l              #$000C0025,D0
  539.             dc.w                $ABEE
  540.         EndM
  541.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  542.         IMPORT_CFM_FUNCTION CMCopyProfile
  543.     ENDIF
  544.  
  545. ;
  546. ; pascal CMError CMValidateProfile(CMProfileRef prof, Boolean *valid, Boolean *preferredCMMnotfound)
  547. ;
  548.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  549.         Macro
  550.         _CMValidateProfile
  551.             move.l              #$000C0026,D0
  552.             dc.w                $ABEE
  553.         EndM
  554.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  555.         IMPORT_CFM_FUNCTION CMValidateProfile
  556.     ENDIF
  557.  
  558. ;
  559. ; pascal CMError CMGetProfileLocation(CMProfileRef prof, CMProfileLocation *theProfile)
  560. ;
  561.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  562.         Macro
  563.         _CMGetProfileLocation
  564.             move.l              #$0008003C,D0
  565.             dc.w                $ABEE
  566.         EndM
  567.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  568.         IMPORT_CFM_FUNCTION CMGetProfileLocation
  569.     ENDIF
  570.  
  571. ;
  572. ; pascal CMError NCMGetProfileLocation(CMProfileRef prof, CMProfileLocation *theProfile, unsigned long *locationSize)
  573. ;
  574.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  575.         Macro
  576.         _NCMGetProfileLocation
  577.             move.l              #$000C0059,D0
  578.             dc.w                $ABEE
  579.         EndM
  580.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  581.         IMPORT_CFM_FUNCTION NCMGetProfileLocation
  582.     ENDIF
  583.  
  584. ;
  585. ; pascal CMError CMFlattenProfile(CMProfileRef prof, unsigned long flags, CMFlattenUPP proc, void *refCon, Boolean *preferredCMMnotfound)
  586. ;
  587.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  588.         Macro
  589.         _CMFlattenProfile
  590.             move.l              #$00140031,D0
  591.             dc.w                $ABEE
  592.         EndM
  593.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  594.         IMPORT_CFM_FUNCTION CMFlattenProfile
  595.     ENDIF
  596.  
  597. ;
  598. ; pascal CMError CMUnflattenProfile(FSSpec *resultFileSpec, CMFlattenUPP proc, void *refCon, Boolean *preferredCMMnotfound)
  599. ;
  600.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  601.         Macro
  602.         _CMUnflattenProfile
  603.             move.l              #$00100032,D0
  604.             dc.w                $ABEE
  605.         EndM
  606.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  607.         IMPORT_CFM_FUNCTION CMUnflattenProfile
  608.     ENDIF
  609.  
  610. ;
  611. ; pascal CMError CMGetProfileHeader(CMProfileRef prof, CMAppleProfileHeader *header)
  612. ;
  613.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  614.         Macro
  615.         _CMGetProfileHeader
  616.             move.l              #$00080039,D0
  617.             dc.w                $ABEE
  618.         EndM
  619.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  620.         IMPORT_CFM_FUNCTION CMGetProfileHeader
  621.     ENDIF
  622.  
  623. ;
  624. ; pascal CMError CMSetProfileHeader(CMProfileRef prof, const CMAppleProfileHeader *header)
  625. ;
  626.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  627.         Macro
  628.         _CMSetProfileHeader
  629.             move.l              #$0008003A,D0
  630.             dc.w                $ABEE
  631.         EndM
  632.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  633.         IMPORT_CFM_FUNCTION CMSetProfileHeader
  634.     ENDIF
  635.  
  636. ;
  637. ; pascal CMError CMProfileElementExists(CMProfileRef prof, OSType tag, Boolean *found)
  638. ;
  639.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  640.         Macro
  641.         _CMProfileElementExists
  642.             move.l              #$000C001E,D0
  643.             dc.w                $ABEE
  644.         EndM
  645.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  646.         IMPORT_CFM_FUNCTION CMProfileElementExists
  647.     ENDIF
  648.  
  649. ;
  650. ; pascal CMError CMCountProfileElements(CMProfileRef prof, unsigned long *elementCount)
  651. ;
  652.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  653.         Macro
  654.         _CMCountProfileElements
  655.             move.l              #$0008001F,D0
  656.             dc.w                $ABEE
  657.         EndM
  658.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  659.         IMPORT_CFM_FUNCTION CMCountProfileElements
  660.     ENDIF
  661.  
  662. ;
  663. ; pascal CMError CMGetProfileElement(CMProfileRef prof, OSType tag, unsigned long *elementSize, void *elementData)
  664. ;
  665.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  666.         Macro
  667.         _CMGetProfileElement
  668.             move.l              #$00100020,D0
  669.             dc.w                $ABEE
  670.         EndM
  671.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  672.         IMPORT_CFM_FUNCTION CMGetProfileElement
  673.     ENDIF
  674.  
  675. ;
  676. ; pascal CMError CMSetProfileElement(CMProfileRef prof, OSType tag, unsigned long elementSize, void *elementData)
  677. ;
  678.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  679.         Macro
  680.         _CMSetProfileElement
  681.             move.l              #$00100023,D0
  682.             dc.w                $ABEE
  683.         EndM
  684.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  685.         IMPORT_CFM_FUNCTION CMSetProfileElement
  686.     ENDIF
  687.  
  688. ;
  689. ; pascal CMError CMSetProfileElementSize(CMProfileRef prof, OSType tag, unsigned long elementSize)
  690. ;
  691.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  692.         Macro
  693.         _CMSetProfileElementSize
  694.             move.l              #$000C0038,D0
  695.             dc.w                $ABEE
  696.         EndM
  697.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  698.         IMPORT_CFM_FUNCTION CMSetProfileElementSize
  699.     ENDIF
  700.  
  701. ;
  702. ; pascal CMError CMSetProfileElementReference(CMProfileRef prof, OSType elementTag, OSType referenceTag)
  703. ;
  704.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  705.         Macro
  706.         _CMSetProfileElementReference
  707.             move.l              #$000C0035,D0
  708.             dc.w                $ABEE
  709.         EndM
  710.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  711.         IMPORT_CFM_FUNCTION CMSetProfileElementReference
  712.     ENDIF
  713.  
  714. ;
  715. ; pascal CMError CMGetPartialProfileElement(CMProfileRef prof, OSType tag, unsigned long offset, unsigned long *byteCount, void *elementData)
  716. ;
  717.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  718.         Macro
  719.         _CMGetPartialProfileElement
  720.             move.l              #$00140036,D0
  721.             dc.w                $ABEE
  722.         EndM
  723.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  724.         IMPORT_CFM_FUNCTION CMGetPartialProfileElement
  725.     ENDIF
  726.  
  727. ;
  728. ; pascal CMError CMSetPartialProfileElement(CMProfileRef prof, OSType tag, unsigned long offset, unsigned long byteCount, void *elementData)
  729. ;
  730.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  731.         Macro
  732.         _CMSetPartialProfileElement
  733.             move.l              #$00140037,D0
  734.             dc.w                $ABEE
  735.         EndM
  736.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  737.         IMPORT_CFM_FUNCTION CMSetPartialProfileElement
  738.     ENDIF
  739.  
  740. ;
  741. ; pascal CMError CMGetIndProfileElementInfo(CMProfileRef prof, unsigned long index, OSType *tag, unsigned long *elementSize, Boolean *refs)
  742. ;
  743.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  744.         Macro
  745.         _CMGetIndProfileElementInfo
  746.             move.l              #$00140021,D0
  747.             dc.w                $ABEE
  748.         EndM
  749.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  750.         IMPORT_CFM_FUNCTION CMGetIndProfileElementInfo
  751.     ENDIF
  752.  
  753. ;
  754. ; pascal CMError CMGetIndProfileElement(CMProfileRef prof, unsigned long index, unsigned long *elementSize, void *elementData)
  755. ;
  756.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  757.         Macro
  758.         _CMGetIndProfileElement
  759.             move.l              #$00100022,D0
  760.             dc.w                $ABEE
  761.         EndM
  762.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  763.         IMPORT_CFM_FUNCTION CMGetIndProfileElement
  764.     ENDIF
  765.  
  766. ;
  767. ; pascal CMError CMRemoveProfileElement(CMProfileRef prof, OSType tag)
  768. ;
  769.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  770.         Macro
  771.         _CMRemoveProfileElement
  772.             move.l              #$00080024,D0
  773.             dc.w                $ABEE
  774.         EndM
  775.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  776.         IMPORT_CFM_FUNCTION CMRemoveProfileElement
  777.     ENDIF
  778.  
  779. ;
  780. ; pascal CMError CMGetScriptProfileDescription(CMProfileRef prof, Str255 name, ScriptCode *code)
  781. ;
  782.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  783.         Macro
  784.         _CMGetScriptProfileDescription
  785.             move.l              #$000C003E,D0
  786.             dc.w                $ABEE
  787.         EndM
  788.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  789.         IMPORT_CFM_FUNCTION CMGetScriptProfileDescription
  790.     ENDIF
  791.  
  792. ;
  793. ; pascal CMError CMCloneProfileRef(CMProfileRef prof)
  794. ;
  795.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  796.         Macro
  797.         _CMCloneProfileRef
  798.             move.l              #$00040042,D0
  799.             dc.w                $ABEE
  800.         EndM
  801.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  802.         IMPORT_CFM_FUNCTION CMCloneProfileRef
  803.     ENDIF
  804.  
  805. ;
  806. ; pascal CMError CMGetProfileRefCount(CMProfileRef prof, long *count)
  807. ;
  808.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  809.         Macro
  810.         _CMGetProfileRefCount
  811.             move.l              #$00080043,D0
  812.             dc.w                $ABEE
  813.         EndM
  814.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  815.         IMPORT_CFM_FUNCTION CMGetProfileRefCount
  816.     ENDIF
  817.  
  818. ;
  819. ; pascal CMError CMProfileModified(CMProfileRef prof, Boolean *modified)
  820. ;
  821.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  822.         Macro
  823.         _CMProfileModified
  824.             move.l              #$00080044,D0
  825.             dc.w                $ABEE
  826.         EndM
  827.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  828.         IMPORT_CFM_FUNCTION CMProfileModified
  829.     ENDIF
  830.  
  831.  
  832. ;  named Color access functions 
  833. ;
  834. ; pascal CMError CMGetNamedColorInfo(CMProfileRef prof, unsigned long *deviceChannels, OSType *deviceColorSpace, OSType *PCSColorSpace, unsigned long *count, StringPtr prefix, StringPtr suffix)
  835. ;
  836.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  837.         Macro
  838.         _CMGetNamedColorInfo
  839.             move.l              #$001C0046,D0
  840.             dc.w                $ABEE
  841.         EndM
  842.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  843.         IMPORT_CFM_FUNCTION CMGetNamedColorInfo
  844.     ENDIF
  845.  
  846. ;
  847. ; pascal CMError CMGetNamedColorValue(CMProfileRef prof, StringPtr name, CMColor *deviceColor, CMColor *PCSColor)
  848. ;
  849.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  850.         Macro
  851.         _CMGetNamedColorValue
  852.             move.l              #$00100047,D0
  853.             dc.w                $ABEE
  854.         EndM
  855.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  856.         IMPORT_CFM_FUNCTION CMGetNamedColorValue
  857.     ENDIF
  858.  
  859. ;
  860. ; pascal CMError CMGetIndNamedColorValue(CMProfileRef prof, unsigned long index, CMColor *deviceColor, CMColor *PCSColor)
  861. ;
  862.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  863.         Macro
  864.         _CMGetIndNamedColorValue
  865.             move.l              #$00100048,D0
  866.             dc.w                $ABEE
  867.         EndM
  868.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  869.         IMPORT_CFM_FUNCTION CMGetIndNamedColorValue
  870.     ENDIF
  871.  
  872. ;
  873. ; pascal CMError CMGetNamedColorIndex(CMProfileRef prof, StringPtr name, unsigned long *index)
  874. ;
  875.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  876.         Macro
  877.         _CMGetNamedColorIndex
  878.             move.l              #$000C0049,D0
  879.             dc.w                $ABEE
  880.         EndM
  881.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  882.         IMPORT_CFM_FUNCTION CMGetNamedColorIndex
  883.     ENDIF
  884.  
  885. ;
  886. ; pascal CMError CMGetNamedColorName(CMProfileRef prof, unsigned long index, StringPtr name)
  887. ;
  888.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  889.         Macro
  890.         _CMGetNamedColorName
  891.             move.l              #$000C004A,D0
  892.             dc.w                $ABEE
  893.         EndM
  894.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  895.         IMPORT_CFM_FUNCTION CMGetNamedColorName
  896.     ENDIF
  897.  
  898.  
  899. ;  Low-level matching functions 
  900. ;
  901. ; pascal CMError NCWNewColorWorld(CMWorldRef *cw, CMProfileRef src, CMProfileRef dst)
  902. ;
  903.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  904.         Macro
  905.         _NCWNewColorWorld
  906.             move.l              #$000C0014,D0
  907.             dc.w                $ABEE
  908.         EndM
  909.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  910.         IMPORT_CFM_FUNCTION NCWNewColorWorld
  911.     ENDIF
  912.  
  913. ;
  914. ; pascal CMError CWConcatColorWorld(CMWorldRef *cw, CMConcatProfileSet *profileSet)
  915. ;
  916.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  917.         Macro
  918.         _CWConcatColorWorld
  919.             move.l              #$00080015,D0
  920.             dc.w                $ABEE
  921.         EndM
  922.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  923.         IMPORT_CFM_FUNCTION CWConcatColorWorld
  924.     ENDIF
  925.  
  926. ;
  927. ; pascal CMError CWNewLinkProfile(CMProfileRef *prof, const CMProfileLocation *targetLocation, CMConcatProfileSet *profileSet)
  928. ;
  929.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  930.         Macro
  931.         _CWNewLinkProfile
  932.             move.l              #$000C0033,D0
  933.             dc.w                $ABEE
  934.         EndM
  935.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  936.         IMPORT_CFM_FUNCTION CWNewLinkProfile
  937.     ENDIF
  938.  
  939. ;
  940. ; pascal void CWDisposeColorWorld(CMWorldRef cw)
  941. ;
  942.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  943.         Macro
  944.         _CWDisposeColorWorld
  945.             move.l              #$00040001,D0
  946.             dc.w                $ABEE
  947.         EndM
  948.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  949.         IMPORT_CFM_FUNCTION CWDisposeColorWorld
  950.     ENDIF
  951.  
  952. ;
  953. ; pascal CMError CWMatchColors(CMWorldRef cw, CMColor *myColors, unsigned long count)
  954. ;
  955.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  956.         Macro
  957.         _CWMatchColors
  958.             move.l              #$000C0002,D0
  959.             dc.w                $ABEE
  960.         EndM
  961.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  962.         IMPORT_CFM_FUNCTION CWMatchColors
  963.     ENDIF
  964.  
  965. ;
  966. ; pascal CMError CWCheckColors(CMWorldRef cw, CMColor *myColors, unsigned long count, long *result)
  967. ;
  968.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  969.         Macro
  970.         _CWCheckColors
  971.             move.l              #$00100003,D0
  972.             dc.w                $ABEE
  973.         EndM
  974.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  975.         IMPORT_CFM_FUNCTION CWCheckColors
  976.     ENDIF
  977.  
  978.  
  979. ;  Bitmap matching 
  980. ;
  981. ; pascal CMError CWMatchBitmap(CMWorldRef cw, CMBitmap *bitmap, CMBitmapCallBackUPP progressProc, void *refCon, CMBitmap *matchedBitmap)
  982. ;
  983.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  984.         Macro
  985.         _CWMatchBitmap
  986.             move.l              #$0010002C,D0
  987.             dc.w                $ABEE
  988.         EndM
  989.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  990.         IMPORT_CFM_FUNCTION CWMatchBitmap
  991.     ENDIF
  992.  
  993. ;
  994. ; pascal CMError CWCheckBitmap(CMWorldRef cw, const CMBitmap *bitmap, CMBitmapCallBackUPP progressProc, void *refCon, CMBitmap *resultBitmap)
  995. ;
  996.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  997.         Macro
  998.         _CWCheckBitmap
  999.             move.l              #$0014002D,D0
  1000.             dc.w                $ABEE
  1001.         EndM
  1002.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1003.         IMPORT_CFM_FUNCTION CWCheckBitmap
  1004.     ENDIF
  1005.  
  1006.  
  1007. ;  Quickdraw-specific matching 
  1008. ;
  1009. ; pascal CMError CWMatchPixMap(CMWorldRef cw, PixMap *myPixMap, CMBitmapCallBackUPP progressProc, void *refCon)
  1010. ;
  1011.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1012.         Macro
  1013.         _CWMatchPixMap
  1014.             move.l              #$00100004,D0
  1015.             dc.w                $ABEE
  1016.         EndM
  1017.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1018.         IMPORT_CFM_FUNCTION CWMatchPixMap
  1019.     ENDIF
  1020.  
  1021. ;
  1022. ; pascal CMError CWCheckPixMap(CMWorldRef cw, PixMap *myPixMap, CMBitmapCallBackUPP progressProc, void *refCon, BitMap *resultBitMap)
  1023. ;
  1024.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1025.         Macro
  1026.         _CWCheckPixMap
  1027.             move.l              #$00140007,D0
  1028.             dc.w                $ABEE
  1029.         EndM
  1030.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1031.         IMPORT_CFM_FUNCTION CWCheckPixMap
  1032.     ENDIF
  1033.  
  1034. ;
  1035. ; pascal CMError NCMBeginMatching(CMProfileRef src, CMProfileRef dst, CMMatchRef *myRef)
  1036. ;
  1037.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1038.         Macro
  1039.         _NCMBeginMatching
  1040.             move.l              #$000C0016,D0
  1041.             dc.w                $ABEE
  1042.         EndM
  1043.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1044.         IMPORT_CFM_FUNCTION NCMBeginMatching
  1045.     ENDIF
  1046.  
  1047. ;
  1048. ; pascal void CMEndMatching(CMMatchRef myRef)
  1049. ;
  1050.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1051.         Macro
  1052.         _CMEndMatching
  1053.             move.l              #$0004000B,D0
  1054.             dc.w                $ABEE
  1055.         EndM
  1056.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1057.         IMPORT_CFM_FUNCTION CMEndMatching
  1058.     ENDIF
  1059.  
  1060. ;
  1061. ; pascal void NCMDrawMatchedPicture(PicHandle myPicture, CMProfileRef dst, Rect *myRect)
  1062. ;
  1063.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1064.         Macro
  1065.         _NCMDrawMatchedPicture
  1066.             move.l              #$000C0017,D0
  1067.             dc.w                $ABEE
  1068.         EndM
  1069.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1070.         IMPORT_CFM_FUNCTION NCMDrawMatchedPicture
  1071.     ENDIF
  1072.  
  1073. ;
  1074. ; pascal void CMEnableMatchingComment(Boolean enableIt)
  1075. ;
  1076.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1077.         Macro
  1078.         _CMEnableMatchingComment
  1079.             move.l              #$0002000D,D0
  1080.             dc.w                $ABEE
  1081.         EndM
  1082.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1083.         IMPORT_CFM_FUNCTION CMEnableMatchingComment
  1084.     ENDIF
  1085.  
  1086. ;
  1087. ; pascal CMError NCMUseProfileComment(CMProfileRef prof, unsigned long flags)
  1088. ;
  1089.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1090.         Macro
  1091.         _NCMUseProfileComment
  1092.             move.l              #$0008003B,D0
  1093.             dc.w                $ABEE
  1094.         EndM
  1095.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1096.         IMPORT_CFM_FUNCTION NCMUseProfileComment
  1097.     ENDIF
  1098.  
  1099. ;
  1100. ; pascal CMError CMCreateProfileIdentifier(CMProfileRef prof, CMProfileIdentifierPtr ident, unsigned long *size)
  1101. ;
  1102.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1103.         Macro
  1104.         _CMCreateProfileIdentifier
  1105.             move.l              #$000C0041,D0
  1106.             dc.w                $ABEE
  1107.         EndM
  1108.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1109.         IMPORT_CFM_FUNCTION CMCreateProfileIdentifier
  1110.     ENDIF
  1111.  
  1112.  
  1113. ;  System Profile access 
  1114. ;
  1115. ; pascal CMError CMGetSystemProfile(CMProfileRef *prof)
  1116. ;
  1117.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1118.         Macro
  1119.         _CMGetSystemProfile
  1120.             move.l              #$00040018,D0
  1121.             dc.w                $ABEE
  1122.         EndM
  1123.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1124.         IMPORT_CFM_FUNCTION CMGetSystemProfile
  1125.     ENDIF
  1126.  
  1127. ;
  1128. ; pascal CMError CMSetSystemProfile(const FSSpec *profileFileSpec)
  1129. ;
  1130.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1131.         Macro
  1132.         _CMSetSystemProfile
  1133.             move.l              #$00040019,D0
  1134.             dc.w                $ABEE
  1135.         EndM
  1136.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1137.         IMPORT_CFM_FUNCTION CMSetSystemProfile
  1138.     ENDIF
  1139.  
  1140. ;
  1141. ; pascal CMError CMGetDefaultProfileBySpace(OSType dataColorSpace, CMProfileRef *prof)
  1142. ;
  1143.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1144.         Macro
  1145.         _CMGetDefaultProfileBySpace
  1146.             move.l              #$0008005A,D0
  1147.             dc.w                $ABEE
  1148.         EndM
  1149.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1150.         IMPORT_CFM_FUNCTION CMGetDefaultProfileBySpace
  1151.     ENDIF
  1152.  
  1153. ;
  1154. ; pascal CMError CMSetDefaultProfileBySpace(OSType dataColorSpace, CMProfileRef prof)
  1155. ;
  1156.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1157.         Macro
  1158.         _CMSetDefaultProfileBySpace
  1159.             move.l              #$0008005B,D0
  1160.             dc.w                $ABEE
  1161.         EndM
  1162.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1163.         IMPORT_CFM_FUNCTION CMSetDefaultProfileBySpace
  1164.     ENDIF
  1165.  
  1166. ;
  1167. ; pascal CMError CMGetProfileByAVID(AVIDType theAVID, CMProfileRef *prof)
  1168. ;
  1169.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1170.         Macro
  1171.         _CMGetProfileByAVID
  1172.             move.l              #$0008005C,D0
  1173.             dc.w                $ABEE
  1174.         EndM
  1175.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1176.         IMPORT_CFM_FUNCTION CMGetProfileByAVID
  1177.     ENDIF
  1178.  
  1179. ;
  1180. ; pascal CMError CMSetProfileByAVID(AVIDType theAVID, CMProfileRef prof)
  1181. ;
  1182.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1183.         Macro
  1184.         _CMSetProfileByAVID
  1185.             move.l              #$0008005D,D0
  1186.             dc.w                $ABEE
  1187.         EndM
  1188.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1189.         IMPORT_CFM_FUNCTION CMSetProfileByAVID
  1190.     ENDIF
  1191.  
  1192.  
  1193. ;  External Profile Management 
  1194. ;
  1195. ; pascal CMError CMNewProfileSearch(CMSearchRecord *searchSpec, void *refCon, unsigned long *count, CMProfileSearchRef *searchResult)
  1196. ;
  1197.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1198.         Macro
  1199.         _CMNewProfileSearch
  1200.             move.l              #$00100027,D0
  1201.             dc.w                $ABEE
  1202.         EndM
  1203.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1204.         IMPORT_CFM_FUNCTION CMNewProfileSearch
  1205.     ENDIF
  1206.  
  1207. ;
  1208. ; pascal CMError CMUpdateProfileSearch(CMProfileSearchRef search, void *refCon, unsigned long *count)
  1209. ;
  1210.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1211.         Macro
  1212.         _CMUpdateProfileSearch
  1213.             move.l              #$000C0028,D0
  1214.             dc.w                $ABEE
  1215.         EndM
  1216.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1217.         IMPORT_CFM_FUNCTION CMUpdateProfileSearch
  1218.     ENDIF
  1219.  
  1220. ;
  1221. ; pascal void CMDisposeProfileSearch(CMProfileSearchRef search)
  1222. ;
  1223.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1224.         Macro
  1225.         _CMDisposeProfileSearch
  1226.             move.l              #$00040029,D0
  1227.             dc.w                $ABEE
  1228.         EndM
  1229.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1230.         IMPORT_CFM_FUNCTION CMDisposeProfileSearch
  1231.     ENDIF
  1232.  
  1233. ;
  1234. ; pascal CMError CMSearchGetIndProfile(CMProfileSearchRef search, unsigned long index, CMProfileRef *prof)
  1235. ;
  1236.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1237.         Macro
  1238.         _CMSearchGetIndProfile
  1239.             move.l              #$000C002A,D0
  1240.             dc.w                $ABEE
  1241.         EndM
  1242.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1243.         IMPORT_CFM_FUNCTION CMSearchGetIndProfile
  1244.     ENDIF
  1245.  
  1246. ;
  1247. ; pascal CMError CMSearchGetIndProfileFileSpec(CMProfileSearchRef search, unsigned long index, FSSpec *profileFile)
  1248. ;
  1249.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1250.         Macro
  1251.         _CMSearchGetIndProfileFileSpec
  1252.             move.l              #$000C002B,D0
  1253.             dc.w                $ABEE
  1254.         EndM
  1255.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1256.         IMPORT_CFM_FUNCTION CMSearchGetIndProfileFileSpec
  1257.     ENDIF
  1258.  
  1259. ;
  1260. ; pascal CMError CMProfileIdentifierFolderSearch(CMProfileIdentifierPtr ident, unsigned long *matchedCount, CMProfileSearchRef *searchResult)
  1261. ;
  1262.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1263.         Macro
  1264.         _CMProfileIdentifierFolderSearch
  1265.             move.l              #$000C003F,D0
  1266.             dc.w                $ABEE
  1267.         EndM
  1268.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1269.         IMPORT_CFM_FUNCTION CMProfileIdentifierFolderSearch
  1270.     ENDIF
  1271.  
  1272. ;
  1273. ; pascal CMError CMProfileIdentifierListSearch(CMProfileIdentifierPtr ident, CMProfileRef *profileList, unsigned long listSize, unsigned long *matchedCount, CMProfileRef *matchedList)
  1274. ;
  1275.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1276.         Macro
  1277.         _CMProfileIdentifierListSearch
  1278.             move.l              #$00140040,D0
  1279.             dc.w                $ABEE
  1280.         EndM
  1281.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1282.         IMPORT_CFM_FUNCTION CMProfileIdentifierListSearch
  1283.     ENDIF
  1284.  
  1285. ;
  1286. ; pascal CMError CMIterateColorSyncFolder(CMProfileIterateUPP proc, unsigned long *seed, unsigned long *count, void *refCon)
  1287. ;
  1288.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1289.         Macro
  1290.         _CMIterateColorSyncFolder
  1291.             move.l              #$00100058,D0
  1292.             dc.w                $ABEE
  1293.         EndM
  1294.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1295.         IMPORT_CFM_FUNCTION CMIterateColorSyncFolder
  1296.     ENDIF
  1297.  
  1298.  
  1299. ;  Utilities 
  1300. ;
  1301. ; pascal CMError CMGetColorSyncFolderSpec(short vRefNum, Boolean createFolder, short *foundVRefNum, long *foundDirID)
  1302. ;
  1303.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1304.         Macro
  1305.         _CMGetColorSyncFolderSpec
  1306.             move.l              #$000C0011,D0
  1307.             dc.w                $ABEE
  1308.         EndM
  1309.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1310.         IMPORT_CFM_FUNCTION CMGetColorSyncFolderSpec
  1311.     ENDIF
  1312.  
  1313. ;
  1314. ; pascal CMError CMGetCWInfo(CMWorldRef cw, CMCWInfoRecord *info)
  1315. ;
  1316.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1317.         Macro
  1318.         _CMGetCWInfo
  1319.             move.l              #$0008001A,D0
  1320.             dc.w                $ABEE
  1321.         EndM
  1322.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1323.         IMPORT_CFM_FUNCTION CMGetCWInfo
  1324.     ENDIF
  1325.  
  1326. ;
  1327. ; pascal CMError CMConvertProfile2to1(CMProfileRef profv2, CMProfileHandle *profv1)
  1328. ;
  1329.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1330.         Macro
  1331.         _CMConvertProfile2to1
  1332.             move.l              #$00080045,D0
  1333.             dc.w                $ABEE
  1334.         EndM
  1335.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1336.         IMPORT_CFM_FUNCTION CMConvertProfile2to1
  1337.     ENDIF
  1338.  
  1339. ;
  1340. ; pascal CMError CMGetPreferredCMM(OSType *cmmType, Boolean *preferredCMMnotfound)
  1341. ;
  1342.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1343.         Macro
  1344.         _CMGetPreferredCMM
  1345.             move.l              #$0008005E,D0
  1346.             dc.w                $ABEE
  1347.         EndM
  1348.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1349.         IMPORT_CFM_FUNCTION CMGetPreferredCMM
  1350.     ENDIF
  1351.  
  1352.  
  1353.  
  1354. ;  ColorSpace conversion functions 
  1355. ;
  1356. ; pascal CMError CMConvertXYZToLab(const CMColor *src, const CMXYZColor *white, CMColor *dst, unsigned long count)
  1357. ;
  1358.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1359.         Macro
  1360.         _CMConvertXYZToLab
  1361.             move.l              #$0010004B,D0
  1362.             dc.w                $ABEE
  1363.         EndM
  1364.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1365.         IMPORT_CFM_FUNCTION CMConvertXYZToLab
  1366.     ENDIF
  1367.  
  1368. ;
  1369. ; pascal CMError CMConvertLabToXYZ(const CMColor *src, const CMXYZColor *white, CMColor *dst, unsigned long count)
  1370. ;
  1371.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1372.         Macro
  1373.         _CMConvertLabToXYZ
  1374.             move.l              #$0010004C,D0
  1375.             dc.w                $ABEE
  1376.         EndM
  1377.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1378.         IMPORT_CFM_FUNCTION CMConvertLabToXYZ
  1379.     ENDIF
  1380.  
  1381. ;
  1382. ; pascal CMError CMConvertXYZToLuv(const CMColor *src, const CMXYZColor *white, CMColor *dst, unsigned long count)
  1383. ;
  1384.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1385.         Macro
  1386.         _CMConvertXYZToLuv
  1387.             move.l              #$0010004D,D0
  1388.             dc.w                $ABEE
  1389.         EndM
  1390.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1391.         IMPORT_CFM_FUNCTION CMConvertXYZToLuv
  1392.     ENDIF
  1393.  
  1394. ;
  1395. ; pascal CMError CMConvertLuvToXYZ(const CMColor *src, const CMXYZColor *white, CMColor *dst, unsigned long count)
  1396. ;
  1397.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1398.         Macro
  1399.         _CMConvertLuvToXYZ
  1400.             move.l              #$0010004E,D0
  1401.             dc.w                $ABEE
  1402.         EndM
  1403.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1404.         IMPORT_CFM_FUNCTION CMConvertLuvToXYZ
  1405.     ENDIF
  1406.  
  1407. ;
  1408. ; pascal CMError CMConvertXYZToYxy(const CMColor *src, CMColor *dst, unsigned long count)
  1409. ;
  1410.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1411.         Macro
  1412.         _CMConvertXYZToYxy
  1413.             move.l              #$000C004F,D0
  1414.             dc.w                $ABEE
  1415.         EndM
  1416.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1417.         IMPORT_CFM_FUNCTION CMConvertXYZToYxy
  1418.     ENDIF
  1419.  
  1420. ;
  1421. ; pascal CMError CMConvertYxyToXYZ(const CMColor *src, CMColor *dst, unsigned long count)
  1422. ;
  1423.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1424.         Macro
  1425.         _CMConvertYxyToXYZ
  1426.             move.l              #$000C0050,D0
  1427.             dc.w                $ABEE
  1428.         EndM
  1429.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1430.         IMPORT_CFM_FUNCTION CMConvertYxyToXYZ
  1431.     ENDIF
  1432.  
  1433. ;
  1434. ; pascal CMError CMConvertRGBToHLS(const CMColor *src, CMColor *dst, unsigned long count)
  1435. ;
  1436.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1437.         Macro
  1438.         _CMConvertRGBToHLS
  1439.             move.l              #$000C0051,D0
  1440.             dc.w                $ABEE
  1441.         EndM
  1442.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1443.         IMPORT_CFM_FUNCTION CMConvertRGBToHLS
  1444.     ENDIF
  1445.  
  1446. ;
  1447. ; pascal CMError CMConvertHLSToRGB(const CMColor *src, CMColor *dst, unsigned long count)
  1448. ;
  1449.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1450.         Macro
  1451.         _CMConvertHLSToRGB
  1452.             move.l              #$000C0052,D0
  1453.             dc.w                $ABEE
  1454.         EndM
  1455.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1456.         IMPORT_CFM_FUNCTION CMConvertHLSToRGB
  1457.     ENDIF
  1458.  
  1459. ;
  1460. ; pascal CMError CMConvertRGBToHSV(const CMColor *src, CMColor *dst, unsigned long count)
  1461. ;
  1462.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1463.         Macro
  1464.         _CMConvertRGBToHSV
  1465.             move.l              #$000C0053,D0
  1466.             dc.w                $ABEE
  1467.         EndM
  1468.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1469.         IMPORT_CFM_FUNCTION CMConvertRGBToHSV
  1470.     ENDIF
  1471.  
  1472. ;
  1473. ; pascal CMError CMConvertHSVToRGB(const CMColor *src, CMColor *dst, unsigned long count)
  1474. ;
  1475.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1476.         Macro
  1477.         _CMConvertHSVToRGB
  1478.             move.l              #$000C0054,D0
  1479.             dc.w                $ABEE
  1480.         EndM
  1481.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1482.         IMPORT_CFM_FUNCTION CMConvertHSVToRGB
  1483.     ENDIF
  1484.  
  1485. ;
  1486. ; pascal CMError CMConvertRGBToGray(const CMColor *src, CMColor *dst, unsigned long count)
  1487. ;
  1488.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1489.         Macro
  1490.         _CMConvertRGBToGray
  1491.             move.l              #$000C0055,D0
  1492.             dc.w                $ABEE
  1493.         EndM
  1494.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1495.         IMPORT_CFM_FUNCTION CMConvertRGBToGray
  1496.     ENDIF
  1497.  
  1498. ;
  1499. ; pascal CMError CMConvertXYZToFixedXYZ(const CMXYZColor *src, CMFixedXYZColor *dst, unsigned long count)
  1500. ;
  1501.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1502.         Macro
  1503.         _CMConvertXYZToFixedXYZ
  1504.             move.l              #$000C0056,D0
  1505.             dc.w                $ABEE
  1506.         EndM
  1507.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1508.         IMPORT_CFM_FUNCTION CMConvertXYZToFixedXYZ
  1509.     ENDIF
  1510.  
  1511. ;
  1512. ; pascal CMError CMConvertFixedXYZToXYZ(const CMFixedXYZColor *src, CMXYZColor *dst, unsigned long count)
  1513. ;
  1514.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1515.         Macro
  1516.         _CMConvertFixedXYZToXYZ
  1517.             move.l              #$000C0057,D0
  1518.             dc.w                $ABEE
  1519.         EndM
  1520.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1521.         IMPORT_CFM_FUNCTION CMConvertFixedXYZToXYZ
  1522.     ENDIF
  1523.  
  1524. ;  PS-related 
  1525. ;
  1526. ; pascal CMError CMGetPS2ColorSpace(CMProfileRef srcProf, unsigned long flags, CMFlattenUPP proc, void *refCon, Boolean *preferredCMMnotfound)
  1527. ;
  1528.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1529.         Macro
  1530.         _CMGetPS2ColorSpace
  1531.             move.l              #$0014002E,D0
  1532.             dc.w                $ABEE
  1533.         EndM
  1534.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1535.         IMPORT_CFM_FUNCTION CMGetPS2ColorSpace
  1536.     ENDIF
  1537.  
  1538. ;
  1539. ; pascal CMError CMGetPS2ColorRenderingIntent(CMProfileRef srcProf, unsigned long flags, CMFlattenUPP proc, void *refCon, Boolean *preferredCMMnotfound)
  1540. ;
  1541.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1542.         Macro
  1543.         _CMGetPS2ColorRenderingIntent
  1544.             move.l              #$0014002F,D0
  1545.             dc.w                $ABEE
  1546.         EndM
  1547.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1548.         IMPORT_CFM_FUNCTION CMGetPS2ColorRenderingIntent
  1549.     ENDIF
  1550.  
  1551. ;
  1552. ; pascal CMError CMGetPS2ColorRendering(CMProfileRef srcProf, CMProfileRef dstProf, unsigned long flags, CMFlattenUPP proc, void *refCon, Boolean *preferredCMMnotfound)
  1553. ;
  1554.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1555.         Macro
  1556.         _CMGetPS2ColorRendering
  1557.             move.l              #$00180030,D0
  1558.             dc.w                $ABEE
  1559.         EndM
  1560.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1561.         IMPORT_CFM_FUNCTION CMGetPS2ColorRendering
  1562.     ENDIF
  1563.  
  1564. ;
  1565. ; pascal CMError CMGetPS2ColorRenderingVMSize(CMProfileRef srcProf, CMProfileRef dstProf, unsigned long *vmSize, Boolean *preferredCMMnotfound)
  1566. ;
  1567.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1568.         Macro
  1569.         _CMGetPS2ColorRenderingVMSize
  1570.             move.l              #$0010003D,D0
  1571.             dc.w                $ABEE
  1572.         EndM
  1573.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1574.         IMPORT_CFM_FUNCTION CMGetPS2ColorRenderingVMSize
  1575.     ENDIF
  1576.  
  1577.  
  1578. ;  ColorSync 1.0 functions which have parallel 2.0 counterparts 
  1579. ;
  1580. ; pascal CMError CWNewColorWorld(CMWorldRef *cw, CMProfileHandle src, CMProfileHandle dst)
  1581. ;
  1582.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1583.         Macro
  1584.         _CWNewColorWorld
  1585.             move.l              #$000C0000,D0
  1586.             dc.w                $ABEE
  1587.         EndM
  1588.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1589.         IMPORT_CFM_FUNCTION CWNewColorWorld
  1590.     ENDIF
  1591.  
  1592. ;
  1593. ; pascal CMError ConcatenateProfiles(CMProfileHandle thru, CMProfileHandle dst, CMProfileHandle *newDst)
  1594. ;
  1595.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1596.         Macro
  1597.         _ConcatenateProfiles
  1598.             move.l              #$000C000C,D0
  1599.             dc.w                $ABEE
  1600.         EndM
  1601.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1602.         IMPORT_CFM_FUNCTION ConcatenateProfiles
  1603.     ENDIF
  1604.  
  1605. ;
  1606. ; pascal CMError CMBeginMatching(CMProfileHandle src, CMProfileHandle dst, CMMatchRef *myRef)
  1607. ;
  1608.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1609.         Macro
  1610.         _CMBeginMatching
  1611.             move.l              #$000C000A,D0
  1612.             dc.w                $ABEE
  1613.         EndM
  1614.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1615.         IMPORT_CFM_FUNCTION CMBeginMatching
  1616.     ENDIF
  1617.  
  1618. ;
  1619. ; pascal void CMDrawMatchedPicture(PicHandle myPicture, CMProfileHandle dst, Rect *myRect)
  1620. ;
  1621.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1622.         Macro
  1623.         _CMDrawMatchedPicture
  1624.             move.l              #$000C0009,D0
  1625.             dc.w                $ABEE
  1626.         EndM
  1627.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1628.         IMPORT_CFM_FUNCTION CMDrawMatchedPicture
  1629.     ENDIF
  1630.  
  1631. ;
  1632. ; pascal CMError CMUseProfileComment(CMProfileHandle profile)
  1633. ;
  1634.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1635.         Macro
  1636.         _CMUseProfileComment
  1637.             move.l              #$00040008,D0
  1638.             dc.w                $ABEE
  1639.         EndM
  1640.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1641.         IMPORT_CFM_FUNCTION CMUseProfileComment
  1642.     ENDIF
  1643.  
  1644. ;
  1645. ; pascal void CMGetProfileName(CMProfileHandle myProfile, CMIString *IStringResult)
  1646. ;
  1647.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1648.         Macro
  1649.         _CMGetProfileName
  1650.             move.l              #$0008000E,D0
  1651.             dc.w                $ABEE
  1652.         EndM
  1653.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1654.         IMPORT_CFM_FUNCTION CMGetProfileName
  1655.     ENDIF
  1656.  
  1657. ;
  1658. ; pascal long CMGetProfileAdditionalDataOffset(CMProfileHandle myProfile)
  1659. ;
  1660.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1661.         Macro
  1662.         _CMGetProfileAdditionalDataOffset
  1663.             move.l              #$0004000F,D0
  1664.             dc.w                $ABEE
  1665.         EndM
  1666.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1667.         IMPORT_CFM_FUNCTION CMGetProfileAdditionalDataOffset
  1668.     ENDIF
  1669.  
  1670.  
  1671. ;  ProfileResponder functions 
  1672. ;
  1673. ; pascal CMError GetProfile(OSType deviceType, long refNum, CMProfileHandle aProfile, CMProfileHandle *returnedProfile)
  1674. ;
  1675.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1676.         Macro
  1677.         _GetProfile
  1678.             move.l              #$00100005,D0
  1679.             dc.w                $ABEE
  1680.         EndM
  1681.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1682.         IMPORT_CFM_FUNCTION GetProfile
  1683.     ENDIF
  1684.  
  1685. ;
  1686. ; pascal CMError SetProfile(OSType deviceType, long refNum, CMProfileHandle newProfile)
  1687. ;
  1688.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1689.         Macro
  1690.         _SetProfile
  1691.             move.l              #$000C0006,D0
  1692.             dc.w                $ABEE
  1693.         EndM
  1694.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1695.         IMPORT_CFM_FUNCTION SetProfile
  1696.     ENDIF
  1697.  
  1698. ;
  1699. ; pascal CMError SetProfileDescription(OSType deviceType, long refNum, long deviceData, CMProfileHandle hProfile)
  1700. ;
  1701.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1702.         Macro
  1703.         _SetProfileDescription
  1704.             move.l              #$00100010,D0
  1705.             dc.w                $ABEE
  1706.         EndM
  1707.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1708.         IMPORT_CFM_FUNCTION SetProfileDescription
  1709.     ENDIF
  1710.  
  1711. ;
  1712. ; pascal CMError GetIndexedProfile(OSType deviceType, long refNum, CMProfileSearchRecordHandle search, CMProfileHandle *returnProfile, long *index)
  1713. ;
  1714.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1715.         Macro
  1716.         _GetIndexedProfile
  1717.             move.l              #$00140012,D0
  1718.             dc.w                $ABEE
  1719.         EndM
  1720.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1721.         IMPORT_CFM_FUNCTION GetIndexedProfile
  1722.     ENDIF
  1723.  
  1724. ;
  1725. ; pascal CMError DeleteDeviceProfile(OSType deviceType, long refNum, CMProfileHandle deleteMe)
  1726. ;
  1727.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1728.         Macro
  1729.         _DeleteDeviceProfile
  1730.             move.l              #$000C0013,D0
  1731.             dc.w                $ABEE
  1732.         EndM
  1733.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1734.         IMPORT_CFM_FUNCTION DeleteDeviceProfile
  1735.     ENDIF
  1736.  
  1737.  
  1738.     IF OLDROUTINENAMES THEN
  1739. ;  constants 
  1740.  
  1741. kMatchCMMType                    EQU        $00000001
  1742. kMatchApplProfileVersion        EQU        $00000002
  1743. kMatchDataType                    EQU        $00000004
  1744. kMatchDeviceType                EQU        $00000008
  1745. kMatchDeviceManufacturer        EQU        $00000010
  1746. kMatchDeviceModel                EQU        $00000020
  1747. kMatchDeviceAttributes            EQU        $00000040
  1748. kMatchFlags                        EQU        $00000080
  1749. kMatchOptions                    EQU        $00000100
  1750. kMatchWhite                        EQU        $00000200
  1751. kMatchBlack                        EQU        $00000400
  1752. ;  types 
  1753. CMYKColor                RECORD 0
  1754. f                         ds        CMCMYKColor
  1755. sizeof                     EQU *                    ; size:   $8 (8)
  1756.                         ENDR
  1757.  
  1758.  
  1759. ; typedef CMWorldRef                     CWorld
  1760.  
  1761. ; typedef long *                        CMGamutResult
  1762.  
  1763. ;  functions 
  1764. ;
  1765. ; pascal void EndMatching(CMMatchRef myRef)
  1766. ;
  1767.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1768.         Macro
  1769.         _EndMatching
  1770.             move.l              #$0004000B,D0
  1771.             dc.w                $ABEE
  1772.         EndM
  1773.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1774.         IMPORT_CFM_FUNCTION EndMatching
  1775.     ENDIF
  1776.  
  1777. ;
  1778. ; pascal void EnableMatching(Boolean enableIt)
  1779. ;
  1780.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1781.         Macro
  1782.         _EnableMatching
  1783.             move.l              #$0002000D,D0
  1784.             dc.w                $ABEE
  1785.         EndM
  1786.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1787.         IMPORT_CFM_FUNCTION EnableMatching
  1788.     ENDIF
  1789.  
  1790. ;
  1791. ; pascal CMError GetColorSyncFolderSpec(short vRefNum, Boolean createFolder, short *foundVRefNum, long *foundDirID)
  1792. ;
  1793.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1794.         Macro
  1795.         _GetColorSyncFolderSpec
  1796.             move.l              #$000C0011,D0
  1797.             dc.w                $ABEE
  1798.         EndM
  1799.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1800.         IMPORT_CFM_FUNCTION GetColorSyncFolderSpec
  1801.     ENDIF
  1802.  
  1803. ;
  1804. ; pascal CMError BeginMatching(CMProfileHandle src, CMProfileHandle dst, CMMatchRef *myRef)
  1805. ;
  1806.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1807.         Macro
  1808.         _BeginMatching
  1809.             move.l              #$000C000A,D0
  1810.             dc.w                $ABEE
  1811.         EndM
  1812.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1813.         IMPORT_CFM_FUNCTION BeginMatching
  1814.     ENDIF
  1815.  
  1816. ;
  1817. ; pascal void DrawMatchedPicture(PicHandle myPicture, CMProfileHandle dst, Rect *myRect)
  1818. ;
  1819.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1820.         Macro
  1821.         _DrawMatchedPicture
  1822.             move.l              #$000C0009,D0
  1823.             dc.w                $ABEE
  1824.         EndM
  1825.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1826.         IMPORT_CFM_FUNCTION DrawMatchedPicture
  1827.     ENDIF
  1828.  
  1829. ;
  1830. ; pascal CMError UseProfile(CMProfileHandle profile)
  1831. ;
  1832.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1833.         Macro
  1834.         _UseProfile
  1835.             move.l              #$00040008,D0
  1836.             dc.w                $ABEE
  1837.         EndM
  1838.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1839.         IMPORT_CFM_FUNCTION UseProfile
  1840.     ENDIF
  1841.  
  1842. ;
  1843. ; pascal void GetProfileName(CMProfileHandle myProfile, CMIString *IStringResult)
  1844. ;
  1845.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1846.         Macro
  1847.         _GetProfileName
  1848.             move.l              #$0008000E,D0
  1849.             dc.w                $ABEE
  1850.         EndM
  1851.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1852.         IMPORT_CFM_FUNCTION GetProfileName
  1853.     ENDIF
  1854.  
  1855. ;
  1856. ; pascal long GetProfileAdditionalDataOffset(CMProfileHandle myProfile)
  1857. ;
  1858.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1859.         Macro
  1860.         _GetProfileAdditionalDataOffset
  1861.             move.l              #$0004000F,D0
  1862.             dc.w                $ABEE
  1863.         EndM
  1864.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1865.         IMPORT_CFM_FUNCTION GetProfileAdditionalDataOffset
  1866.     ENDIF
  1867.  
  1868.     ENDIF    ; OLDROUTINENAMES
  1869.  
  1870. ;  Deprecated stuff
  1871.  
  1872. ;  PrGeneral parameter blocks 
  1873. TEnableColorMatchingBlk    RECORD 0
  1874. iOpCode                     ds.w    1                ; offset: $0 (0)
  1875. iError                     ds.w    1                ; offset: $2 (2)
  1876. lReserved                 ds.l    1                ; offset: $4 (4)
  1877. hPrint                     ds.l    1                ; offset: $8 (8)
  1878. fEnableIt                 ds.b    1                ; offset: $C (12)
  1879. filler                     ds.b    1                ; offset: $D (13)
  1880. sizeof                     EQU *                    ; size:   $E (14)
  1881.                         ENDR
  1882. TRegisterProfileBlk        RECORD 0
  1883. iOpCode                     ds.w    1                ; offset: $0 (0)
  1884. iError                     ds.w    1                ; offset: $2 (2)
  1885. lReserved                 ds.l    1                ; offset: $4 (4)
  1886. hPrint                     ds.l    1                ; offset: $8 (8)
  1887. fRegisterIt                 ds.b    1                ; offset: $C (12)
  1888. filler                     ds.b    1                ; offset: $D (13)
  1889. sizeof                     EQU *                    ; size:   $E (14)
  1890.                         ENDR
  1891.     ENDIF ; __CMAPPLICATION__ 
  1892.  
  1893.